import React from 'react';
import { Button, Result } from 'antd';
import { useNavigate } from 'react-router-dom';

const NotFound: React.FC = () => {
  const navigate = useNavigate();
  const goBackToHome = () => navigate('/');
  return (
    <Result
      status='404'
      title='404'
      subTitle='您访问的页面不存在'
      extra={
        <Button type='primary' onClick={goBackToHome}>
          回到主页
        </Button>
      }
    />
  );
};

export default NotFound;
